package com.hks.web.controller;

import com.hks.common.utils.ResponseResult;
import com.hks.pojo.Menu;
import com.hks.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/tree")
    public ResponseResult getTree(){
        List<Menu> menuTree = menuService.getMenuTree();
        return new ResponseResult(200,"获取成功",menuTree);
    }
}
